package com.hanhanxiaochong.zhongxiangchuanmei.view.my.adapter;

import android.content.Context;

import com.hanhanxiaochong.zhongxiangchuanmei.R;
import com.hanhanxiaochong.zhongxiangchuanmei.bean.BankCardBean;
import com.hanhanxiaochong.zhongxiangchuanmei.config.CommonAdapter;
import com.hanhanxiaochong.zhongxiangchuanmei.config.ViewHolder;

import java.util.List;

/**
 * Author : 贾桐
 * E-mail : 653773284@qq.com
 * Time   : 2018/6/11.
 * Desc   : 银行卡adapter
 */

public class BankCardAdapter extends CommonAdapter<BankCardBean> {

    public BankCardAdapter(Context context, int layoutId, List<BankCardBean> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, BankCardBean bankCardBean, int position) {
        holder.setText(R.id.txt_bank_name, bankCardBean.getCa_bankname().substring(0,4));

        holder.setText(R.id.txt_bankcard_type, bankCardBean.getCa_bankname().substring(bankCardBean.getCa_bankname().length()-3, bankCardBean.getCa_bankname().length()));

        holder.setText(R.id.txt_bankcard_num, "****  ****  ****  " + bankCardBean.getCa_number().replaceAll(" ", "").substring(bankCardBean.getCa_number().replaceAll(" ", "").length()-4, bankCardBean.getCa_number().replaceAll(" ", "").length()));

//        ImageView bankLogoImg = holder.getView(R.id.img_banklogo);
//        GlideImgManager.glideLoader(mContext, bankCardBean.getCa_img(), R.mipmap.img_error, R.mipmap.img_error, bankLogoImg, 0);
    }
}
